package com.woniuxy.threeproject.end_water_project_user.service.impl;

import com.woniuxy.threeproject.end_water_project_user.domain.Employee;
import com.woniuxy.threeproject.end_water_project_user.dao.EmployeeMapper;
import com.woniuxy.threeproject.end_water_project_user.exception.EndWaterRuntimeException;
import com.woniuxy.threeproject.end_water_project_user.service.IEmployeeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 员工表 服务实现类
 * </p>
 *
 * @author Lucas
 * @since 2021-08-25
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {
    @Resource
    public EmployeeMapper employeeMapper;
    @Override
    public Employee addEmploy(Employee e) {
        int i = employeeMapper.insert(e);
        if(i>0){
            return e;
        }else{
           throw  new EndWaterRuntimeException("添加员工时service数据库失败!");
        }

    }
}
